' We have to check if any of the characters received
' are carriage returns or backspaces, and process
' them accordingly
For i = 1 To Len(RecvData)
Select Case Mid$(RecvData, i, 1)
Case Chr$(13) ' Carriage return
' Even though only a Chr$(13) is sent, under
' Windows a return is Chr$(13)+Chr$(10).
txtRecv = txtRecv & Chr$(13) & Chr$(10)
Case Chr$(8) ' Backspace
txtRecv = Left$(txtRecv, Len(txtRecv) - 1)
Case Else ' Normal
txtRecv = txtRecv + Mid$(RecvData, i, 1)
End Select
Next i
End Sub
Sub tcpListen_Accept (NewSession As Long)
' Only create a new session if no session currently
' exists
If tcpConnect.State = CLOSED Then
tcpConnect.Session = NewSession
Else
suc% = MessageBox(Me.hWnd, "Talk could not accept a new connection from a remote computer; only one at a time is allowed." & Chr$(10) & Chr$(10) & "If you are trying to connect to yourself, you must use two copies of Talk, and have one connect to the other.", "Connection Refused", 0)
End If
End Sub
Sub tcpListen_Exception (ErrorCode As Integer, ErrorDesc As String)
If ErrorCode = PT_CLOSED Or ErrorCode = PT_ABORTED Then